Skip to content

ENG-11734 | feat(osf): add DownloadEvent model and migration with dashb…#11810

Merged
sh-andriy merged 4 commits into
feature/download-telemetryfrom
ENG-11734-downloadevent-model
Jul 16, 2026
Merged

ENG-11734 | feat(osf): add DownloadEvent model and migration with dashb…#11810
sh-andriy merged 4 commits into
feature/download-telemetryfrom
ENG-11734-downloadevent-model

Conversation

@sh-andriy

Copy link
Copy Markdown
Collaborator

…oard access group

Ticket

Purpose

Changes

Side Effects

QE Notes

CE Notes

Documentation

Comment on lines +7 to +14
DASHBOARD_USERS = [
'sheredko.andriy@gmail.com',
'bodintsov@exoft.net',
'isokhan@exoft.net',
'ykopka@exoft.net',
'bgeiger@cos.io',
'osmand@cos.io',
]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ramya shouldn't have access? She is in the channel as well

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — added her.

Comment on lines +24 to +25
# what was downloaded
resource_guid = models.CharField(max_length=255, blank=True, default='', db_index=True)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be FK to Node or AbstractNode (in case of downloading files from Registration)?
If it's for a case when a node is deleted, ignore this comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kept it as a plain GUID string on purpose. This telemetry is specifically for the August mass-deletion of private projects, so the resources will get hard-deleted — an FK would cascade/null and we'd lose which project the download was for, which defeats the point. Storing the GUID keeps the record durable.
It also covers nodes, registrations and preprints uniformly (a preprint isn't an AbstractNode, so a Node FK wouldn't fit those). So yeah — the node-deletion case you mentioned is exactly why it's a string.

Comment thread osf/models/download_event.py Outdated
# what was downloaded
resource_guid = models.CharField(max_length=255, blank=True, default='', db_index=True)
path = models.TextField(blank=True, default='')
name = models.CharField(max_length=255, blank=True, default='')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What will "name" contain? If file name, then can't we extract name from a file path? If folder name, we can fetch it from path as well

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair — dropped it. It's just the basename of path, so we'll derive it in the dashboard when we need it instead of storing it twice.

@sh-andriy
sh-andriy merged commit 9cda5cc into feature/download-telemetry Jul 16, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants